#include "menu.h"


void create_menu(){
	int color = BLUE_BACK | BLUE;
	clear_text_screen();
	drawFrame("PONG", BLUE, 2, 1, 77, 22);
	
	printCharAt('#', 3+27, 2, color); printCharAt('#', 3+27, 3, color); printCharAt('#', 3+27, 4, color); printCharAt('#', 3+27, 5, color); printCharAt('#', 3+27, 6, color);
	printCharAt('#', 4+27, 2, color); printCharAt('#', 4+27, 4, color);
	printCharAt('#', 5+27, 2, color); printCharAt('#', 5+27, 4, color);
	printCharAt('#', 6+27, 3, color);
	
	printCharAt('#', 8+27, 2, color); printCharAt('#', 8+27, 3, color); printCharAt('#', 8+27, 4, color); printCharAt('#', 8+27, 5, color); printCharAt('#', 8+27, 6, color);
	printCharAt('#', 9+27, 2, color); printCharAt('#', 9+27, 6, color);
	printCharAt('#', 10+27, 2, color); printCharAt('#', 10+27, 6, color);
	printCharAt('#', 11+27, 2, color); printCharAt('#', 11+27, 3, color); printCharAt('#', 11+27, 4, color); printCharAt('#', 11+27, 5, color); printCharAt('#', 11+27, 6, color);
	
	printCharAt('#', 13+27, 2, color); printCharAt('#', 13+27, 3, color); printCharAt('#', 13+27, 4, color); printCharAt('#', 13+27, 5, color); printCharAt('#', 13+27, 6, color);
	printCharAt('#', 14+27, 3, color);
	printCharAt('#', 15+27, 4, color);
	printCharAt('#', 16+27, 2, color); printCharAt('#', 16+27, 3, color); printCharAt('#', 16+27, 4, color); printCharAt('#', 16+27, 5, color); printCharAt('#', 16+27, 6, color);
	
	printCharAt('#', 18+27, 2, color); printCharAt('#', 18+27, 3, color); printCharAt('#', 18+27, 4, color); printCharAt('#', 18+27, 5, color); printCharAt('#', 18+27, 6, color);
	printCharAt('#', 19+27, 2, color); printCharAt('#', 19+27, 6, color);
	printCharAt('#', 20+27, 2, color); printCharAt('#', 20+27, 4, color); printCharAt('#', 20+27, 6, color);
	printCharAt('#', 21+27, 2, color); printCharAt('#', 21+27, 4, color); printCharAt('#', 21+27, 5, color); printCharAt('#', 21+27, 6, color); 
	
	int i;
	for(i = 3; i <= 78; i++){
		printCharAt(205, i, 7, BLUE);
	}
	printStringAt("Pong", 38, 7, BLUE);
	
	printStringAt("1. Play", 20, 9, GREEN);
	printStringAt("2. Options", 20, 11, GREEN);
	printStringAt("3. Exit", 20, 13, GREEN);
	
}

void menu_exit(){
	drawFrame("Exit", GREEN, 3, 8, 74, 14);
	printStringAt("Are you sure you want to exit?", 20, 9, RED);
	printStringAt("1. Yes", 20, 11, RED);
	printStringAt("2. No", 20, 13, BLUE);
}

void menu_options(){
	drawFrame("Options", GREEN, 3, 8, 74, 14);
	
	printStringAt("1. Controls", 20, 10, RED);
	printStringAt("2. Dificulty", 20, 12, RED);
	printStringAt("3. Back", 20, 14, BLUE);

}

void menu_controls(){
	drawFrame("Controls", RED, 4, 9, 72, 12);
	
	printStringAt("Player 1:", 20, 11, CYAN);
	printStringAt("Up -> q", 29, 12, CYAN);
	printStringAt("Down -> a", 29, 13, CYAN);
	
	printStringAt("Player 2:", 20, 15, CYAN);
	printStringAt("Up -> o", 29, 16, CYAN);
	printStringAt("Down -> l", 29, 17, CYAN);
	
	printStringAt("1. Back", 20, 19, GREEN);

}

void menu_dificulty(){
	drawFrame("Dificulty", RED, 4, 9, 72, 12);
	
	printStringAt("1. Easy", 20, 11,CYAN);
	printStringAt("2. Medium", 20, 12, CYAN);
	printStringAt("3. Hard", 20, 13, CYAN);
	printStringAt("4. Back", 20, 15, GREEN);
	
}
